/**
 * Function Information Part for dragonscript
 * Copyright (C) 2009 Hajime Yoshimori <RoarLudros@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "DragonFuncPart"

dragon::DragonFuncPart::DragonFuncPart(std::wstring token, bool param, bool omittable, bool repeat)
  : _token(token), 
    _omittable(omittable), 
    _select(false), 
    _repeat(repeat), 
    _space(false), 
    _param(param),
    _sub_parts(NULL) {
	
}

dragon::DragonFuncPart::DragonFuncPart(DragonSentence* sub_parts, bool select, bool omittable, bool repeat)
  : _token(L""), 
    _omittable(omittable), 
    _select(select), 
    _repeat(repeat), 
    _space(false), 
    _param(false),
    _sub_parts(sub_parts) {
	
}

dragon::DragonFuncPart::DragonFuncPart(bool omittable)
  : _token(L""),
    _omittable(omittable),
    _select(false),
    _repeat(false),
    _space(true),
    _param(false),
    _sub_parts(NULL) {
	
}

dragon::DragonFuncPart::~DragonFuncPart() {
  delete _sub_parts;
}

const std::wstring& dragon::DragonFuncPart::getToken() const {
  return _token;
}

bool dragon::DragonFuncPart::getOmittable() const {
  return _omittable;
}

bool dragon::DragonFuncPart::getSelection() const {
  return _select;
}

bool dragon::DragonFuncPart::getRepeat() const {
  return _repeat;
}

const dragon::DragonSentence* dragon::DragonFuncPart::getSubParts() const {
  return _sub_parts;
}
